#pragma once

#include <string>
#include <vector>

namespace ftp
{

enum FileSystemError
{
	kSuccess,
	kFileOrPathDoesNotExist,
	kNoPermissions
};

class File;

class FileSystem
{
public:
	virtual ~FileSystem() {}

	virtual void rename(const std::string& oldPath, const std::string& newPath, FileSystemError* error) = 0;

	virtual bool doesDirectoryExist(const std::string& dir) = 0;
	virtual void removeDirectory(const std::string& dir, FileSystemError* error) = 0;
	virtual void createDirectory(const std::string& dir, FileSystemError* error) = 0;
	virtual void readDirectory(const std::string& dir, std::vector<std::string>* fileNames, FileSystemError* error) = 0;

	virtual std::auto_ptr<File> openFile(const std::string& dir, FileSystemError* error) = 0;
};

class File 
{
public:
	virtual ~File() {}

	virtual int read(char* buffer, size_t size) = 0;
	virtual int write(const char* buffer, size_t size) = 0;
};

} //ftp